# !/usr/bin/python3
# -*- coding: utf-8 -*-

"""
菜单权限表模型类
----------------------------------------------------
@Project :   xinhou-openai-framework
@File    :   Menu.py
@Contact :   sp_hrz@qq.com

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/04/16 22:04  peng.shen   v1.0.0     None
"""

from sqlalchemy import ForeignKey
from sqlalchemy import func

from sqlalchemy import Column, Integer, String, Text, Numeric, TIMESTAMP
from xinhou_openai_framework.core.orm.entity.BaseEntity import BaseEntity


class Menu(BaseEntity):
    # 数据表名&字段
    __tablename__ = 't_menu'

    menu_name = Column(String(50), comment="菜单名称")
    parent_id = Column(Integer, default='0', comment="父菜单ID:join=t_menu,index=1")
    order_num = Column(Integer, default='0', comment="显示顺序")
    url = Column(String(200), default='#', comment="请求地址")
    menu_type = Column(Integer, comment="菜单类型:1=目录,2=菜单,3=按钮")
    perms = Column(String(100), comment="权限标识")
    level = Column(Integer, default='0', comment="菜单层级")
    icon = Column(String(100), default='#', comment="菜单图标")
    is_frame = Column(Integer, default='2', comment="是否外链")
    remark = Column(String(500), comment="备注")
    visible = Column(Integer, default='1', comment="菜单状态:1=显示,2=隐藏")
